home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Web Designer 98 (Professional)
/
WebDesigner 1.0.iso
/
cgi2
/
make_list.pl
< prev
next >
Wrap
Perl Script
|
1996-06-03
|
881b
|
50 lines
#!/usr/bin/perl
# Create List of URLS From Free For All Link Page
# Created by Matt Wright on 12/15/95
# Version 1.0 Last Modified: 12/15/95
# Usage: make_list.pl <infile> <outfile>
$num = @ARGV;
if ($num == 2) {
($infile,$outfile) = @ARGV;
}
else {
print "Wrong Number of Arguments!\n\n";
print "USAGE:\n";
print "make_list.pl <infile> <outfile>\n";
print "\n";
exit;
}
if (-e $infile) {
open(LINKS,$infile);
@lines = <LINKS>;
close(LINKS);
}
else {
print "No Such File: $infile!\n";
print "\n";
exit;
}
foreach $line (@lines) {
chop($line);
if ($line =~ /<a href=\"(.*)\">.*<\/a>/) {
$cur_url = $1;
if ($1 =~ /^http:\/\//) {
push(@URLS,$cur_url);
$urls++;
}
}
}
open(DATA,">$outfile");
foreach $url (@URLS) {
print DATA "$url\n";
}
close(DATA);
print "$urls URLs Added To $outfile!\n\n";